import java.util.Arrays;

public class test5 {
    public static void main(String[] args) {
       int[] arr = {1,2,2,2,1,1,2};
        System.out.println(num(arr));
    }
    public static int num(int[] arr){
        Arrays.sort(arr);
        return arr[arr.length/2];
    }
}
